@import './variable.styl'
// 背景图片
// bg-image($url)
//   background-image: url($url + "@2x.png")
//   @media (-webkit-min-device-pixel-ratio: 3),(min-device-pixel-ratio: 3)
//     background-image: url($url + "@3x.png")

// 背景图片
bg-image($url)
  background: url($url) no-repeat center center
  background-size: cover

bg-img($color)
  background: $color

// 不换行
no-wrap()
  text-overflow: ellipsis
  overflow: hidden
  white-space: nowrap

// 超出几行省略
no-wrap-num($num)
  overflow: hidden
  text-overflow: ellipsis
  display: -webkit-box
  -webkit-box-orient: vertical
  -webkit-line-clamp: $num

// 扩展点击区域
extend-click()
  position: relative
  &:before
    content: ''
    position: absolute
    top: -10px
    left: -10px
    right: -10px
    bottom: -10px

flex-row()
  width 100%
  display flex
  flex-flow row nowrap
  justify-content space-between
  align-items center

flex-row-wrap()
  width 100%
  display flex
  flex-flow row wrap
  justify-content space-between
  align-items center

flex-around()
  width 100%
  display flex
  flex-flow row nowrap
  justify-content space-around
  align-items center

flex-around-wrap()
  width 100%
  display flex
  flex-flow row wrap
  justify-content space-around
  align-items center

border-t(color)
  position: absolute; 
  content: '';
  width: 100%;
  left: 0;
  top: 0;
  height: 1px;
  background-color: color;
  -webkit-transform: scale(1, 0.5);
  transform: scale(1, 0.5);
  -webkit-transform-origin: center top;
  transform-origin: center top;

border-b()
  position: absolute; 
  content: '';
  width: 100%;
  left: 0;
  bottom: 0;
  height: 1px;
  background-color: $border-color;
  -webkit-transform: scale(1, 0.5);
  transform: scale(1, 0.5);
  -webkit-transform-origin: center bottom;
  transform-origin: center bottom;

rows(num)
  overflow: hidden
  display: -webkit-box
  text-overflow: ellipsis
  -webkit-box-orient: vertical
  -webkit-line-clamp: num
  word-break: break-all

title()
  font-size 16px
  font-weight bold
  line-height 20px
  margin 4px 0

desc()
  font-size 14px
  line-height 18px
  margin 4px 0
  color: #666666